<style lang="sass">
    .nav-bar {
        height: 36px;
        line-height: 36px;
        display: flex;
        color: #999;
        position: fixed;
        z-index:1000;
        left: 0;
        top: 0;
        width: 100%;
        border-bottom: 1px solid #f2f2f2;
        background-color: #fff;

        .left-btn,
        .right-btn {
            width: 42px;
            text-align: center;
            line-height: 36px;
            font-size: 18px;
        }
        .left-btn {
            border-right: 1px solid #f2f2f2;
        }
        .right-btn {
            border-left: 1px solid #f2f2f2;
            .iconfont{
                transform: rotate(180deg);
                display: block;
            }
        }
        .page-title {
            flex-grow: 1;
            text-align: center;
            height: 100%;
        }
    }
</style>

<template>
    <nav class="nav-bar">
        <span @click="leftAction()" class="left-btn"><i class="iconfont icon-icon18"></i></span>
        <span class="page-title">{{title}}</span>
        <span @click="rightAction()" class="right-btn"><i class="iconfont icon-icon18"></i></span>
    </nav>
</template>

<script>
    import '../../sass/common/iconfont.scss';

    export default {
        props: ['title'],
        methods: {
            leftAction (){
                window.history.go(-1)
            },
            rightAction (){
                window.history.go(1)
            } 
        }
    }
</script>